package cn.clazz.interfaced

/**
  * Created by lzd on 2018/9/5.
  */
trait Logger {
  def log(message:String) = println(message)
}
class Person(val name:String) extends Logger{
  def makeFridends(p:Person): Unit ={
    println("I'm "+name+" i'm glade to make friends with you "+p.name);
    log("makeFridends method invoked!!")
  }
}
object Test1{
  def main(args: Array[String]) {
    val p1=new Person("linpingzhi")
    val p2=new Person("yuelingshan");
    p1.makeFridends(p2)
  }
}
